{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<a href=\"https://user-images.githubusercontent.com/19553554/71825144-2d568180-30d6-11ea-8ee0-63c849cfd934.png\" target=\"_blank\"><img align=\"left\" style=\"width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;\"></a>\n",
    "*pyecharts 是一个用于生成 Echarts 图表的类库。Echarts 是百度开源的一个数据可视化 JS 库。用 Echarts 生成的图可视化效果非常棒，为了与 Python 进行对接，方便在 Python 中直接使用数据生成图，于是有人开发出了这个项目[GitHub](https://github.com/pyecharts/pyecharts) .*\n",
    "\n",
    "*Note.建议本程序在参看https://github.com/pyecharts/pyecharts 的安装步骤后再运行； 本程序所有的例子都是从官方提供的样例代码[GitHub](https://github.com/pyecharts/pyecharts-gallery)中提取的,如果对某个API有疑问建议在IDE里面查看*\n",
    "\n",
    "*Echart类型图种大全:https://echarts.apache.org/examples/zh/#chart-type-line pyecharts图导入到ppt中的方法:https://baijiahao.baidu.com/s?id=1663839456876951842&wfr=spider&for=pc.*\n",
    "\n",
    "*作者: LBQ; 时间:2020/7/24. 邮箱:779660843@qq.com*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d2f45437e85c41dd9557df103047bb6b\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d2f45437e85c41dd9557df103047bb6b = echarts.init(\n",
       "                    document.getElementById('d2f45437e85c41dd9557df103047bb6b'), 'white', {renderer: 'canvas'});\n",
       "                var option_d2f45437e85c41dd9557df103047bb6b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"name\": \"\\u4e1a\\u52a1\\u6307\\u6807\",\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 55.5\n",
       "                }\n",
       "            ],\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\": true\n",
       "            },\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": \"{a} <br/>{b} : {c}%\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d2f45437e85c41dd9557df103047bb6b.setOption(option_d2f45437e85c41dd9557df103047bb6b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837c975ef0>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "###建议就看最后一个例子\n",
    "\n",
    "\n",
    "\n",
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Gauge\n",
    "\n",
    "\"\"\"\n",
    "Gallery 使用 pyecharts 1.1.0\n",
    "参考地址: https://echarts.baidu.com/examples/editor.html?c=gauge\n",
    "\n",
    "目前无法实现的功能:\n",
    "\n",
    "1、暂无\n",
    "\"\"\"\n",
    "\n",
    "gg = (\n",
    "    Gauge()\n",
    "    .add(series_name=\"业务指标\", data_pair=[[\"完成率\", 55.5]])\n",
    "    .set_global_opts(\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=True, formatter=\"{a} <br/>{b} : {c}%\"),\n",
    "    )\n",
    "    #.render(\"gauge.html\")\n",
    ")\n",
    "gg.load_javascript()\n",
    "gg.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"366af3d01c724454aa18affa0d10aed0\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_366af3d01c724454aa18affa0d10aed0 = echarts.init(\n",
       "                    document.getElementById('366af3d01c724454aa18affa0d10aed0'), 'white', {renderer: 'canvas'});\n",
       "                var option_366af3d01c724454aa18affa0d10aed0 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387                         \",\n",
       "                    \"value\": 66.6\n",
       "                }\n",
       "            ],\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gauge-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_366af3d01c724454aa18affa0d10aed0.setOption(option_366af3d01c724454aa18affa0d10aed0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837d465c18>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e1 = (\n",
    "    Gauge()\n",
    "    .add(\"\", [(\"完成率                         \", 66.6)])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Gauge-基本示例\"))\n",
    "    #.render(\"gauge_base.html\")\n",
    ")\n",
    "e1.load_javascript()\n",
    "e1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b7a0690c18d646fd97ef0f9d269cec38\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_b7a0690c18d646fd97ef0f9d269cec38 = echarts.init(\n",
       "                    document.getElementById('b7a0690c18d646fd97ef0f9d269cec38'), 'white', {renderer: 'canvas'});\n",
       "                var option_b7a0690c18d646fd97ef0f9d269cec38 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"name\": \"\\u4e1a\\u52a1\\u6307\\u6807\",\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 55.5\n",
       "                }\n",
       "            ],\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 30,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": [\n",
       "                        [\n",
       "                            0.3,\n",
       "                            \"#67e0e3\"\n",
       "                        ],\n",
       "                        [\n",
       "                            0.7,\n",
       "                            \"#37a2da\"\n",
       "                        ],\n",
       "                        [\n",
       "                            1,\n",
       "                            \"#fd666d\"\n",
       "                        ]\n",
       "                    ]\n",
       "                }\n",
       "            },\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\": true\n",
       "            },\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": \"{a} <br/>{b} : {c}%\",\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_b7a0690c18d646fd97ef0f9d269cec38.setOption(option_b7a0690c18d646fd97ef0f9d269cec38);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837d465c50>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#风格渲染\n",
    "e2=(\n",
    "    Gauge()\n",
    "    .add(series_name=\"业务指标\", data_pair=[[\"完成率\", 55.5]])\n",
    "    .set_global_opts(\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "        tooltip_opts=opts.TooltipOpts(is_show=True, formatter=\"{a} <br/>{b} : {c}%\"),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        axisline_opts=opts.AxisLineOpts(\n",
    "            linestyle_opts=opts.LineStyleOpts(\n",
    "                color=[[0.3, \"#67e0e3\"], [0.7, \"#37a2da\"], [1, \"#fd666d\"]], width=30\n",
    "            )\n",
    "        )\n",
    "    )\n",
    "    #.render(\"gauge_change_color.html\")\n",
    ")\n",
    "e2.load_javascript()\n",
    "e2.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"8b1abe2a62234c8589e9840ad24b2195\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_8b1abe2a62234c8589e9840ad24b2195 = echarts.init(\n",
       "                    document.getElementById('8b1abe2a62234c8589e9840ad24b2195'), 'white', {renderer: 'canvas'});\n",
       "                var option_8b1abe2a62234c8589e9840ad24b2195 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"50%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 66.6\n",
       "                }\n",
       "            ],\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gauge-\\u4fee\\u6539 Radius \\u4e3a 50%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_8b1abe2a62234c8589e9840ad24b2195.setOption(option_8b1abe2a62234c8589e9840ad24b2195);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837c92d588>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e3 = (\n",
    "    Gauge()\n",
    "    .add(\"\", [(\"完成率\", 66.6)], radius=\"50%\")\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Gauge-修改 Radius 为 50%\"))\n",
    "    #.render(\"gauge_change_radius.html\")\n",
    ")\n",
    "e3.load_javascript()\n",
    "e3.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"10f4dd02af7d4873a78e505d228a28a3\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_10f4dd02af7d4873a78e505d228a28a3 = echarts.init(\n",
       "                    document.getElementById('10f4dd02af7d4873a78e505d228a28a3'), 'white', {renderer: 'canvas'});\n",
       "                var option_10f4dd02af7d4873a78e505d228a28a3 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"name\": \"\\u4e1a\\u52a1\\u6307\\u6807\",\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 55.5\n",
       "                }\n",
       "            ],\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 30,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": [\n",
       "                        [\n",
       "                            0.3,\n",
       "                            \"#67e0e3\"\n",
       "                        ],\n",
       "                        [\n",
       "                            0.7,\n",
       "                            \"#37a2da\"\n",
       "                        ],\n",
       "                        [\n",
       "                            1,\n",
       "                            \"#fd666d\"\n",
       "                        ]\n",
       "                    ]\n",
       "                }\n",
       "            },\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\": true\n",
       "            },\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gauge-\\u4e0d\\u540c\\u989c\\u8272\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_10f4dd02af7d4873a78e505d228a28a3.setOption(option_10f4dd02af7d4873a78e505d228a28a3);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837c94c2e8>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e4 = (\n",
    "    Gauge()\n",
    "    .add(\n",
    "        \"业务指标\",\n",
    "        [(\"完成率\", 55.5)],\n",
    "        axisline_opts=opts.AxisLineOpts(\n",
    "            linestyle_opts=opts.LineStyleOpts(\n",
    "                color=[(0.3, \"#67e0e3\"), (0.7, \"#37a2da\"), (1, \"#fd666d\")], width=30\n",
    "            )\n",
    "        ),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Gauge-不同颜色\"),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    #.render(\"gauge_color.html\")\n",
    ")\n",
    "e4.load_javascript()\n",
    "e4.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"6a433d77dcda48599d60c4372ba94a1b\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_6a433d77dcda48599d60c4372ba94a1b = echarts.init(\n",
       "                    document.getElementById('6a433d77dcda48599d60c4372ba94a1b'), 'white', {renderer: 'canvas'});\n",
       "                var option_6a433d77dcda48599d60c4372ba94a1b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"color\": \"blue\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 40,\n",
       "                \"fontFamily\": \"Microsoft YaHei\"\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"formatter\": \"{value}%\",\n",
       "                \"color\": \"auto\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 10,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 66.6\n",
       "                }\n",
       "            ],\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gauge-\\u6539\\u53d8\\u8f6e\\u76d8\\u5185\\u7684\\u5b57\\u4f53\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_6a433d77dcda48599d60c4372ba94a1b.setOption(option_6a433d77dcda48599d60c4372ba94a1b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837c94c0b8>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e5 = (\n",
    "    Gauge()\n",
    "    .add(\n",
    "        \"\",\n",
    "        [(\"完成率\", 66.6)],\n",
    "        title_label_opts=opts.LabelOpts(\n",
    "            font_size=40, color=\"blue\", font_family=\"Microsoft YaHei\"\n",
    "        ),\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Gauge-改变轮盘内的字体\"))\n",
    "    #.render(\"gauge_label_title_setting.html\")\n",
    ")\n",
    "e5.load_javascript()\n",
    "e5.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e96a27de5c8e4b07bd65183d96a78571\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_e96a27de5c8e4b07bd65183d96a78571 = echarts.init(\n",
       "                    document.getElementById('e96a27de5c8e4b07bd65183d96a78571'), 'white', {renderer: 'canvas'});\n",
       "                var option_e96a27de5c8e4b07bd65183d96a78571 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"gauge\",\n",
       "            \"title\": {\n",
       "                \"show\": true,\n",
       "                \"offsetCenter\": [\n",
       "                    0,\n",
       "                    \"-40%\"\n",
       "                ],\n",
       "                \"color\": \"#333\",\n",
       "                \"fontStyle\": \"normal\",\n",
       "                \"fontWeight\": \"normal\",\n",
       "                \"fontFamily\": \"sans-serif\",\n",
       "                \"fontSize\": 15,\n",
       "                \"backgroundColor\": \"transparent\",\n",
       "                \"borderColor\": \"transparent\",\n",
       "                \"borderWidth\": 0,\n",
       "                \"borderRadius\": 0,\n",
       "                \"padding\": 0,\n",
       "                \"shadowColor\": \"transparent\",\n",
       "                \"shadowBlur\": 0,\n",
       "                \"shadowOffsetX\": 0,\n",
       "                \"shadowOffsetY\": 0\n",
       "            },\n",
       "            \"detail\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value}\"\n",
       "            },\n",
       "            \"name\": \"\\u4e1a\\u52a1\\u6307\\u6807\",\n",
       "            \"min\": 0,\n",
       "            \"max\": 100,\n",
       "            \"splitNumber\": 5,\n",
       "            \"radius\": \"75%\",\n",
       "            \"startAngle\": 225,\n",
       "            \"endAngle\": -45,\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b8c\\u6210\\u7387\",\n",
       "                    \"value\": 55.5\n",
       "                }\n",
       "            ],\n",
       "            \"axisLine\": {\n",
       "                \"show\": true,\n",
       "                \"onZero\": true,\n",
       "                \"onZeroAxisIndex\": 0,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 30,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\",\n",
       "                    \"color\": [\n",
       "                        [\n",
       "                            0.3,\n",
       "                            \"#67e0e3\"\n",
       "                        ],\n",
       "                        [\n",
       "                            0.7,\n",
       "                            \"#37a2da\"\n",
       "                        ],\n",
       "                        [\n",
       "                            1,\n",
       "                            \"#fd666d\"\n",
       "                        ]\n",
       "                    ]\n",
       "                }\n",
       "            },\n",
       "            \"pointer\": {\n",
       "                \"show\": true,\n",
       "                \"length\": \"80%\",\n",
       "                \"width\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u4e1a\\u52a1\\u6307\\u6807\": true\n",
       "            },\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Gauge-\\u5206\\u5272\\u6bb5\\u6570-Label\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_e96a27de5c8e4b07bd65183d96a78571.setOption(option_e96a27de5c8e4b07bd65183d96a78571);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f837c947f28>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "e6 = (\n",
    "    Gauge()\n",
    "    .add(\n",
    "        \"业务指标\",\n",
    "        [(\"完成率\", 55.5)],\n",
    "        split_number=5,\n",
    "        axisline_opts=opts.AxisLineOpts(\n",
    "            linestyle_opts=opts.LineStyleOpts(\n",
    "                color=[(0.3, \"#67e0e3\"), (0.7, \"#37a2da\"), (1, \"#fd666d\")], width=30\n",
    "            )\n",
    "        ),\n",
    "        detail_label_opts=opts.LabelOpts(formatter=\"{value}\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Gauge-分割段数-Label\"),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    #.render(\"gauge_splitnum_label.html\")\n",
    ")\n",
    "e6.load_javascript()\n",
    "e6.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
